#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define fir first
#define sec second
#define chmin(a,b) (a=min(a,b))
#define chmax(a,b) (a=max(a,b))
int n,cnt[100010],m,ans,s;
signed main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)
    {

        int x;
        cin>>x;
        cnt[x]++;
        chmax(m,x);
    }
    for(int i=1;i<=m;i++)
    {
        int t=min(cnt[i],s);
        s-=t;
        s+=cnt[i];
        ans+=t;
    }
    ans=n-ans;
    cout<<ans;
    return 0;
}
// 14:10.
